From 149a2b87e05a70a943a1ea88ed25f249d51cc0a4 Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Fri, 10 Nov 2023 14:14:56 -0700 Subject: [PATCH] misc cleanups (#1213) initialize garmin_fs class member. catch gui up with Qt 5.15 floor. rename tidy build directory. --- garmin_fs.h | 2 +- gui/formatload.cc | 7 ------- gui/main.cc | 2 +- tools/ci_run_tidy.sh | 8 ++++---- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/garmin_fs.h b/garmin_fs.h index ac74e8957..00c16074b 100644 --- a/garmin_fs.h +++ b/garmin_fs.h @@ -119,7 +119,7 @@ public: QString fax_nr; /* fax number */ QString postal_code; /* postal code */ QString email; /* email address */ - unsigned int duration; /* expected travel time to next route point, in seconds, only when auto-routed */ + unsigned int duration{0}; /* expected travel time to next route point, in seconds, only when auto-routed */ QList ilinks; #ifdef GMSD_EXPERIMENTAL diff --git a/gui/formatload.cc b/gui/formatload.cc index 23d24fb39..046e16f12 100644 --- a/gui/formatload.cc +++ b/gui/formatload.cc @@ -34,9 +34,6 @@ #include // for QVariant #include // for QApplication #include // for QMessageBox -#ifdef GENERATE_CORE_STRINGS -#include // for QT_VERSION, QT_VERSION_CHECK -#endif #include "appname.h" // for appName @@ -48,11 +45,7 @@ extern QTextStream* generate_output_stream; static QString xlt(const QString& f) { #ifdef GENERATE_CORE_STRINGS -#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0)) - *generate_output_stream << "QT_TRANSLATE_NOOP(\"core\",\"" << f << "\")" << endl; -#else *generate_output_stream << "QT_TRANSLATE_NOOP(\"core\",\"" << f << "\")" << Qt::endl; -#endif #endif return QCoreApplication::translate("core", f.toUtf8().constData()); } diff --git a/gui/main.cc b/gui/main.cc index 60788074e..6ad489aa8 100644 --- a/gui/main.cc +++ b/gui/main.cc @@ -32,7 +32,7 @@ int main(int argc, char** argv) // MIN_QT_VERSION in GPSBabel.pro should correspond to the QT_VERSION_CHECK // arguments in main.cc and gui/main.cc and the version check in // CMakeLists.txt, gui/CMakeLists.txt. -#if (QT_VERSION < QT_VERSION_CHECK(5, 12, 0)) +#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0)) #error this version of Qt is not supported. #endif diff --git a/tools/ci_run_tidy.sh b/tools/ci_run_tidy.sh index 813043835..6d0eff7e4 100755 --- a/tools/ci_run_tidy.sh +++ b/tools/ci_run_tidy.sh @@ -7,16 +7,16 @@ CODACY_CLANG_TIDY=$(curl -s https://api.github.com/repos/codacy/codacy-clang-tid CHECKS="clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,modernize-*,bugprone-*,google-*,misc-*,performance-*,readability-*,-cppcoreguidelines-pro-type-vararg,-modernize-use-trailing-return-type,-readability-identifier-length" HEADERFILTER=".*" -mkdir bld -cd bld +mkdir bld-tidy +cd bld-tidy cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DGPSBABEL_ENABLE_PCH=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. # generate included ui files cmake --build . cd .. # exclude third party library source -jq '[.[]|select(.file|contains("zlib")|not)] | [.[]|select(.file|contains("shapelib")|not)] | [.[]|select(.file|contains("bld")|not)]' \ -bld/compile_commands.json \ +jq '[.[]|select(.file|contains("zlib")|not)] | [.[]|select(.file|contains("shapelib")|not)] | [.[]|select(.file|contains("bld-tidy")|not)]' \ +bld-tidy/compile_commands.json \ > compile_commands.json # run-clang-tidy may still be forcing injection of escape sequences for colors. -- 2.30.2